﻿using System;
using System.ServiceModel;
using Ayatta.Contract.Domain;
using System.Collections.Generic;

namespace Ayatta.Contract
{
    [ServiceContract(Namespace = ServiceContract.Namespace)]
    public interface IStoreService : IService
    {
        #region

        [OperationContract]
        IList<CategoryGroup> CategoryGroupList(int group);

        [OperationContract]
        IList<ProductCategory> ProductCategoryList(int parentId);

        [OperationContract]
        IList<ProductCategoryProp> ProductCategoryPropList(int categoryId);

        [OperationContract]
        IList<ProductCategoryPropValue> ProductCategoryPropValueList(int categoryId);

        #endregion

        #region Discount

        [OperationContract]
        bool CreateDiscount(Discount o);

        [OperationContract]
        Discount GetDiscount(int id);

        [OperationContract]
        PagedList<Discount> GetPagedDiscount(int size = 20, int index = 1, DiscountAssignedTo? assignedTo = null,
                                            bool? usePercentage = null, bool? status = null);

        [OperationContract]
        bool CreateDiscountRequirement(DiscountRequirement o);

        [OperationContract]
        IList<DiscountRequirement> GetDiscountRequirement(int discountId);

        //[OperationContract]
        //IList<Discount> GetAvailableDiscount();



        [OperationContract]
        bool ValidateDiscount(int discountId, int limitationTimes, int? userId);


        [OperationContract]
        IList<Discount> GetDiscounts(int userId);

        #endregion



        #region ProductItem

        [OperationContract]
        MagicKit<int> ProductItemCreate(ProductItem o);
        /*
        [OperationContract]
        int CreateProductItem(ProductItem o);
        */
        [OperationContract]
        ProductItem ProductItemNameGet(int id);

        [OperationContract]
        PagedList<ProductItem> ProductItemPagedList(int page = 1, int size = 20, byte param = 0, int? userId = null, int? id = null, string name = null, string outerId = null, int? categoryRootId = null, decimal? priceFrom = null, decimal? priceTo = null, int? saleFrom = null, int? saleTo = null, IDictionary<string, string> orderBy = null);

        [OperationContract]
        bool ProductItemNameUpdate(int id, int userId, string name, string subName);

        [OperationContract]
        bool ProductItemPriceUpdate(int id, int userId, decimal price, IDictionary<int, decimal> prices);

        [OperationContract]
        bool ProductItemQuantityUpdate(int id, int userId, int quantity, IDictionary<int, int> quantities);

        [OperationContract]
        ProductItemSku GetSku(int id);

        #endregion
        [OperationContract]
        ProductItem ProductItemGet(int id, int? userId = null);

        [OperationContract]
        ProductItem ProductItemPriceQuantityGet(int id, int? userId = null);


        #region ProductAuction

        [OperationContract]
        bool ProductAuctionCreate(ProductAuction o);

        [OperationContract]
        bool ProductAuctionUpdate(ProductAuction o);

        [OperationContract]
        bool ProductAuctionDelete(int id);

        [OperationContract]
        ProductAuction ProductAuctionGet(int id,int sellerId=0);

        [OperationContract]
        PagedList<ProductAuction> ProductAuctionPagedList(int page = 1, int size = 20, int id = 0, string name = null,
                                                          int itemId = 0, int userId = 0, string userName = null,
                                                          byte? level = null, int? group = null, bool? isZero = null,
                                                          bool? isAuto = null, bool? isVirtual = null,
                                                          bool? diffBuy = null, bool? freeBid = null,
                                                          bool? reservation = null, bool? dynamic = null,
                                                          AuctionStatus? status = null, DateTime? onlineDate = null,
                                                          DateTime? finishedDate = null, int sellerId = 0);

        #endregion

    }
}
